import { createRouter, createWebHistory } from 'vue-router'
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'

const base = qiankunWindow.__POWERED_BY_QIANKUN__ ? '/app/micro-vue-app3' : '/micro-vue-app3/'
const router = createRouter({
  history: createWebHistory(base),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: () => import('@/views/layout/layout.vue'),
      redirect: '/home2',
      children: [
        {
          path: '/home2',
          name: 'home2',
          component: () => import('@/views/home/home.vue'),
          meta: {
            title: '首页22',
          },
        },
        {
          path: '/about2',
          name: 'about2',
          component: () => import('@/views/about/about.vue'),
          meta: {
            title: 'about22',
          },
        },
      ],
    },
  ],
})

export default router
